<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div id="app">
        <button v-on:click="hello('张三')">点击</button>

        <hr>
        <input v-model.trim="msg"><br/>
        <input v-model.number="age"><br/>
        <div>当前年龄：{{age}}</div><br/>
        <button @click="add">年龄加一</button>
    </div>


<script src="js/vue.js"></script>
<script>
    new Vue({
        el:"#app",
        data:{
            msg:"hello vue",
            age:18,
        },
        methods:{
            hello(name){
                alert(name+this.msg)
            },
            add(){
                this.age++
            }

        }
    })
</script>
</body>
</html>